<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<base href="<%=basePath%>">

<title>用户注册</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="css/mystyle.css">

<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/messages_zh.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<script type="text/javascript" src="js/validator-login.js"></script>
<style>
.error {
	font-size: 10;
	color: black;
}
</style>
</head>

<body>
	<header>
	<div class="nav">
		<c:if test="${lf==null}">
			<form id="LoginForm" action="LoginServlet" method="post">
				<label style="color:red;font-size:12px;">欢迎光临集大杂货铺,请登录</label>
				<label style="margin-left:20px;">用户名:</label><input style="margin-left:5px;border-radius:5px;width: 140px;" type="text" id="username" name="username" />
				<label style="margin-left:20px;">密码:</label><input style="margin-left:5px;border-radius:5px;width: 140px;" type="password" id="password" name="password" />
				<button class="btn-home" type="submit">登录</button>
				<button class="btn-home" type="button" onclick="window.location.href='sign.jsp'">注册</button>
				<a class="divhover" style="margin-left: 20px;" href="GetTenGoodsServlet">首页</a> 
				<a class="divhover" onclick="if(${empty lf}) alert('请先登录');" href="servlet/GetOrderList">个人订单</a>
				<a class="divhover" onclick="if(${empty lf}) alert('请先登录');" href="GetTenGoodsServlet">购物车</a>
			</form>
		</c:if>
		
		<c:if test="${lf!=null}">
			<a>欢迎 , ${user.uname},您上次登录时间是${lastlogintime} </a>
			<a href="userinfo.jsp?uid=${user.uid}">修改信息</a>
			<a href="LogoutServlet?uid=${user.uid}">注销</a>
			<a href="GetTenGoodsServlet">首页</a>
			<a href="servlet/GetOrderList">个人订单</a>
			<a href="servlet/ShowShoppingcart">购物车</a>
		</c:if>
		<div id="time">
			<script>
				document.getElementById('time').innerHTML = new Date()
						.toLocaleString()
						+ ' 星期' + '日一二三四五六'.charAt(new Date().getDay());
				setInterval(
						"document.getElementById('time').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",
						1000);
			</script>
		</div>
	</div>
	</header>

	<div class="signborder">
		<div align="center" style="height: 100px;margin:10px auto;">
			<img src="image/battle.bmp">
		</div>
		<form id="signupForm" action="SignServlet" method="post">
			<div class="signtext" style="margin:30px">
				<span>用户名:</span><input id="username" type="text" name="username"/><br>
				<span>密码:</span><input id="spassword" type="password" name="password" onblur="checkpas1();" required="true"/><br>
				<span>确认密码:<span><input id="repeatpassword" type="password" name="repeatpassword" required="true" onChange="checkpas();"/>
				<span class="tip" style="font-size:10;color: black;">两次输入的密码不一致</span><br>
				<span>邮箱:</span><input id="txtEmail" type="text" name="email" />
				<span id="spinfo" style="font-size:10;color: black;"></span>
				<br><br><br>
				<button type="submit" class="search-button" style="margin-top:0px" onclick="checkpas2();">注册</button>
				<button type="repeat" class="search-button" style="margin-top:0px">重置</button>
			</div>
		</form>
	</div>
</body>

</html>